#include "main.h"
#include "Platform/Simulation.h"
#include "Platform/WinEntry.h"

class Application : public Simulation {
public:
	Application() {}

	~Application() {}

	VOID SetupPerGameSettings() override;

	VOID Initialize() override;

	VOID Update() override;

private:
	CTimer _Timer;
};

ENTRYAPP(Application)

VOID Application::SetupPerGameSettings() {
	
	LoadString(_hInstance, IDS_WINDOW_NAME, _WindowName, MAX_PATH);
	LoadString(_hInstance, IDS_CLASS_NAME, _ClassName, MAX_PATH);

	_hIcon = LoadIcon(_hInstance, MAKEINTRESOURCE(IDI_TANK));
}

VOID Application::Initialize()
{
	_Timer.SetTime(1);
	_Timer.Start();
}

VOID Application::Update() {

	DOUBLE start = _Timer.Peek();
	_gfx->Render();
	DOUBLE end = _Timer.Peek();

	std::ostringstream oss;
	oss << std::fixed << std::setprecision(2) << end - start << "=============\n\n\n";
	OutputDebugStringA(oss.str().c_str());
}

